package game.com.game.action;

import game.com.game.Persion;
import game.com.game.Shop;

/**
 * Created by maizhipeng on 2017/5/3.
 */

public class ShopAction extends AbstractAction{
    private Shop mShop;

    public ShopAction(Shop shop) {
        mShop = shop;
    }

    @Override
    public void start(Persion persion) {
        if(persion.getX()!=mShop.getX()||persion.getY()!=mShop.getY()){
            WalkAction walkAction =new WalkAction(persion.getX(),persion.getY(),mShop.getX(),mShop.getY());
            walkAction.setIActionListener(new IActionListener() {

                @Override
                public void onFinish() {
                    startShopping();

                }
            });
            walkAction.start(persion);
        }else{
            startShopping();
        }
    }



    private void startShopping(){

    }
}
